// var mongodb=require('mongodb');
// var MongoClient = require('mongodb').MongoClient;
// var DB_CONN_STR = 'mongodb://wxnet:wxnet\@O2o_137#@192.168.1.214:8107/WeiXinNet';    
var mongo={
    HuiGeUser:{
        NickName:"",
        __dbname:"HuiGeUser"
    }
}
Object.prototype.find=function(query,callback){
    var mongo = require('mongodb'); 
    var db= new mongo.Db("WeiXinNet", new mongo.Server( '192.168.1.214', 8107, {}), {}); 
    var that=this;
    db.open(function(e,dddd){
        db.authenticate("wxnet", "wxnet@O2o_137#", function(err, res) {
            db.collection(that.__dbname).find(query).toArray(function(err1,data){
                    callback(data)
                })
        });

    });
}


mongo.HuiGeUser.find({NickName:/任春雷/},function(data){
    console.log(data);
})


// MongoClient.connect(DB_CONN_STR, function(err, db) {
//     console.log("连接成功！");
    
// });
